Optimal. Leaf size=54 \[ \frac{B \sin (c+d x) \cos (c+d x)}{2 d}+\frac{B x}{2}-\frac{C \sin ^3(c+d x)}{3 d}+\frac{C \sin (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0631004, antiderivative size = 54, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.192, Rules used = {3010, 2748, 2635, 8, 2633} \[ \frac{B \sin (c+d x) \cos (c+d x)}{2 d}+\frac{B x}{2}-\frac{C \sin ^3(c+d x)}{3 d}+\frac{C \sin (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3010
Rule 2748
Rule 2635
Rule 8
Rule 2633
Rubi steps
\begin{align*} \int \cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx &=\int \cos ^2(c+d x) (B+C \cos (c+d x)) \, dx\\ &=B \int \cos ^2(c+d x) \, dx+C \int \cos ^3(c+d x) \, dx\\ &=\frac{B \cos (c+d x) \sin (c+d x)}{2 d}+\frac{1}{2} B \int 1 \, dx-\frac{C \operatorname{Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{d}\\ &=\frac{B x}{2}+\frac{C \sin (c+d x)}{d}+\frac{B \cos (c+d x) \sin (c+d x)}{2 d}-\frac{C \sin ^3(c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 0.06226, size = 57, normalized size = 1.06 \[ \frac{B (c+d x)}{2 d}+\frac{B \sin (2 (c+d x))}{4 d}-\frac{C \sin ^3(c+d x)}{3 d}+\frac{C \sin (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.012, size = 49, normalized size = 0.9 \begin{align*}{\frac{1}{d} \left ({\frac{C \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) }{3}}+B \left ({\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2}}+{\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.21927, size = 62, normalized size = 1.15 \begin{align*} \frac{3 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B - 4 \,{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C}{12 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.5606, size = 105, normalized size = 1.94 \begin{align*} \frac{3 \, B d x +{\left (2 \, C \cos \left (d x + c\right )^{2} + 3 \, B \cos \left (d x + c\right ) + 4 \, C\right )} \sin \left (d x + c\right )}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.611654, size = 95, normalized size = 1.76 \begin{align*} \begin{cases} \frac{B x \sin ^{2}{\left (c + d x \right )}}{2} + \frac{B x \cos ^{2}{\left (c + d x \right )}}{2} + \frac{B \sin{\left (c + d x \right )} \cos{\left (c + d x \right )}}{2 d} + \frac{2 C \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac{C \sin{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\x \left (B \cos{\left (c \right )} + C \cos ^{2}{\left (c \right )}\right ) \cos{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.27177, size = 63, normalized size = 1.17 \begin{align*} \frac{1}{2} \, B x + \frac{C \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac{B \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac{3 \, C \sin \left (d x + c\right )}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]